﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebVideo.Areas.Admin.Models
{
    public class ThongBaoModel
    {
        public string NoiDung { get; set; }
        public int? Status { get; set; }
        public static ThongBaoModel LayModel(int id)
        {
            ThongBaoModel tb = new ThongBaoModel();
            dbVideoDataContext db = new dbVideoDataContext();
            EntityThongBao tnew = db.EntityThongBaos.Where(g=>g.Id == id).First();
            tb.Status = tnew.Status;
            tb.NoiDung = tnew.NoiDung;
            return tb;

        }
        public static void Edit(ThongBaoModel Mtnew, int id)
        {
            dbVideoDataContext db = new dbVideoDataContext();
            EntityThongBao tnew = db.EntityThongBaos.Where(g => g.Id == id).First();
            tnew.Status = Mtnew.Status;
            tnew.NoiDung = Mtnew.NoiDung;            
            db.SubmitChanges();
        }

    }
}